<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // async/await语法
        async function fn() {
            return 100
        }
        (async function () {
            const a = fn(); // async返回的是Promise，
            const b = await fn() // await相当于then，所以返回100
        });

        // 第二题
        (async function () {
            console.log('start');
            const a = await 100;
            console.log('a', a);
            const b = await Promise.resolve(200)
        })
    </script>
</body>

</html>